#!/usr/bin/python
# coding=utf-8
from flask import Flask, request
from flask_restplus import Api, Resource, fields


def create_module(p_app=None, p_api=None):
    ns = p_api.namespace('api_teacher', description='教师信息模块的API列表')

    @ns.route('/TeacherList.sdo')
    class TeacherList(Resource):
        """
        Shows a list of all todos, and lets you POST to add new tasks
        """

        @ns.doc('add new book')
        def post(self):
            """

            Below is the post body example:
            {
                "name": "tom",
                "age": 18,
                "sex": 1
            }
            """
            print(request.headers)

            response = "success"
            status_code = 200
            return response, status_code
